﻿module Sustainalytics.Common {

    require(['Scripts/libs/toastr'], function (toastr) {

        var mod = angular.module(commonModuleName);

        mod.factory('notificationFactory', [function () {
            toastr.options.timeOut = 3000;
            toastr.options.extendedTimeOut = 3000;
            toastr.options.target = '#ceva';
            return {
                success: function (notificationMessage: string) {
                    var message = notificationMessage || "Success";
                    toastr.success(message);
                },
                error: function (text, errorMessage) {
                    toastr.error(text, errorMessage);
                },
            };
        }]);
    });
}